#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import with_statement

from urllib2 import urlopen

from BeautifulSoup import BeautifulSoup

def parseFile(path):
    with open(path, 'r') as f:
        return parseString(f.read())

def parseUrl(url):
    return parseString(urlopen(url).read())

def parseString(html):
    return BeautifulSoup(html)